<template>
  <div class="content">
  <el-tabs type="card">
    <el-form label-width="">
          <el-row id="compay"></el-row>
        <el-table :data="curriculumListData" border fit highlight-current-row style="width: 100%">
          <el-table-column align="center" label="服务商" prop="serviceName">
          </el-table-column>
          <el-table-column align="center" label="时间" prop="loginTime">
          </el-table-column>
          <el-table-column align="center" label="设备号" prop="deviceNo">
          </el-table-column>
          <el-table-column align="center" label="地点" prop="loginAddress">
          </el-table-column>
          <el-table-column align="center" label="使用时长" prop="timeString">
          </el-table-column>
        </el-table>
      </el-form>
    </el-tabs>
  </div>
</template>

<script>
// import tabPane from '@/components/tabPane'
import axios from 'axios'
import api from "@/api/servier"
export default {
    data() {
      return {
        list: [{
        ii: "888"
      }],
      curriculumListData: [],
      curriculumListShow: [],
      materialData: [],
      demo: {
        name: ""
      },
      appsData: [],
      };
    },
    mounted(){
      this.curriculumList()
    },
    methods: {
      timeFormat(time) {
        var d = new Date(time); 
        var times=d.getFullYear() + '-' + (d.getMonth() + 1) + '-' + d.getDate() + ' ' + d.getHours() + ':' + d.getMinutes() + ':' + d.getSeconds()
        return times;
      },
      curriculumList() {
        api.serviceLogLook(this.$route.query.oid).then(response => {
          console.log(response)
          response.map((item, index) => {
            response[index].loginTime = this.timeFormat(item.loginTime)
            response[index].loginLeave = this.timeFormat(item.loginLeave)
          })
          this.curriculumListData = response
        })
      }
    }
  }
</script>

<style scoped>
  .tab-container{
    margin: 30px;
  }
  .content {
    margin-left: 30px;
    margin-top: 30px;
  }
</style>
